package com.lagou.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Random;
import java.util.concurrent.TimeUnit;

@Slf4j
@Service("userService")
public class UserServiceImpl implements UserService {
    @Override
    public String sayHello(String word) {
        try {
            // 设置随机延迟
            TimeUnit.MILLISECONDS.sleep(new Random().nextInt(1000) + 1);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        log.info("调用成功--参数 " + word);
        return "success";
    }
}
